<!DOCTYPE html>
<html lang="zh-CN">
  <head>
	<?php require APP_PATH_WEB_ANLS.'Report/common/web_doc_meta.php';?>
    <title>条件过滤</title>
    <?php require APP_PATH_WEB_ANLS.'Report/common/web_doc_link.php';?>
    <?php require APP_PATH_WEB_ANLS.'Report/common/web_doc_script.php';?>
	<style>
        #dataView {display: none; position: absolute;z-index:9999999;background-color: border: 1px solid #f9f9f9; background-color: white;
            padding: 5px;
           }
        .tr_bg_red { background-color: #c52d2d !important; color: white !important;}
    </style>
  
    <script type="text/javascript">

		function selectCode(code){
			$.ajax({
				url:'/Anls/report/setChartAutoView?code='+code
				,dataType:'json'
				,success:function(data){
					
				}
			});
		}
    
        function initAnlsData(){
    		$.ajax({
    			url:'/Anls/filter/getFilterData'
    			,dataType:'json'
    			,success:function(data){
    				if(!data) return false;
    				anlsData = data;
    				var tr = "";
    				console.info(data);
    				for(var i=0;i<data.length;i++){
						var _data = data[i];
						var code = _data['code'];
						var date = _data['date'];
						var highWinLtCur = _data['highWinLt.cur'];
						var loseLimitCur = _data['loseLimit.cur'];
						var shift = _data['shift'];
						if(highWinLtCur>8){
    						tr += "<tr class='tr_bg_red'>";
    					} else {
    						tr += "<tr>";
    					}
						var btn = "<input type='button' id='code_"+code+"' value='"+code+"' class='btn btn-default' onclick=selectCode('"+code+"') />";
						tr += "<td code='"+code+"'>" + btn + "</td>";
						tr += "<td>" + shift + "</td>";
    					tr += "<td>" + date + "</td>";
    					tr += "<td>" + highWinLtCur + "</td>";
    					tr += "<td>" + loseLimitCur + "</td>";
    					tr += "</tr>";
        			}
    				$("#dataTable tbody").html(tr);
    				
    			}
    		});
    	}
    
		$(function(){
			initAnlsData();
		});
    </script>
  </head>

  <body>
    <?php require APP_PATH_WEB_ANLS.'Report/common/nav.php';?>
    <div class="container-fluid">
      <div class="row">
        <?php require APP_PATH_WEB_ANLS.'Report/common/sidebar.php';?>
        
          <h2 class="sub-header">条件过滤</h2>
          
         	<table class="table table-striped" id="dataTable">
              <thead>
                <tr>
                  <th>品种</th>
                  <th>发生事件</th>
                  <th>日期</th>
                  <th>连输</th>
                  <th>赢利&lt;5</th>
                </tr>
              </thead>
              <tbody>
                                
              </tbody>
            </table>
        </div>
      </div>
      
    </div><!-- end main -->

  </body>
</html>
